<template>
  <div class="userCreatAlbumCpm">
    <GlobalCategoryItem
      v-if="userCreateAlbum.length != 0"
      :list="userCreateAlbum"
    />
  </div>
</template>

<script>
import { getUserAlbum } from "../../../../../api/userDetailsApi";
import { getCount } from "../../../../../utils/format";
import moment from "moment";
export default {
  name: "userCreatAlbumCpm",
  props: {
    uid: {
      required: true,
      type: String,
    },
  },
  components: {},
  data() {
    return {
      userCreateAlbum: [], // 用户创建的歌单
    };
  },
  created() {
    this.getUserAlbumMethod();
  },
  methods: {
    async getUserAlbumMethod() {
      try {
        this.userCreateAlbum = [];
        let result = await getUserAlbum(this.uid);
        if (result.code === 200) {
          //  要用户创建的歌单
          result.playlist.forEach((item) => {
            if (!item.subscribed) {
              this.userCreateAlbum.push(item);
            }
          });
        }
      } catch (error) {}
    },
  },
  computed: {},
};
</script>

<style lang="less" scoped>
.userCreatAlbumCpm {
}
</style>
